import Vue from 'vue'
import VueRouter from 'vue-router'

import Find from '@/views/Find'
import My from '@/views/My'
import Friend from '@/views/Friend'

import NotFound from '@/components/NotFound.vue'

Vue.use(VueRouter)

const router = new VueRouter({
  linkActiveClass: 'active',
  linkExactActiveClass: 'active-exact',

  // mode: 'history',

  routes: [
    {
      // 路径 锚点
      // 组件
      path: '/',
      redirect: '/find',
    },
    {
      // 路径 锚点
      // 组件
      name: 'find',
      path: '/find',
      component: Find,
    },
    {
      name: 'my',
      path: '/my',
      component: My,
    },
    {
      name: 'part',
      path: '/part',
      component: Friend,
    },

    {
      name: 'part',
      path: '/part/:username/:password',
      component: Friend,
    },

    {
      path: '*',
      component: NotFound,
    },
  ],
})

export default router
